package com.chhuang.huaao.po;

import java.io.Serializable;
import java.util.Date;
import com.chhuang.core.model.AbstractPersistentModel;
import com.chhuang.core.validation.ValidGroupSave;
import com.chhuang.core.validation.ValidGroupUpdate;
import com.sun.xml.bind.CycleRecoverable;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;

/**
* HaLog Model
* @author ChHuang
* @date Sun Apr 30 20:37:44 CST 2017
*/
public class HaLog extends AbstractPersistentModel implements CycleRecoverable{
	private static final long serialVersionUID = -7860553164624293763L;
	@NotNull(message="{HaLog.logId.NotNull}",groups={ValidGroupUpdate.class})
	@Size(max=32,message="{HaLog.logId.Size}",groups={ValidGroupSave.class})
	private String logId;
	public String getLogId(){
		return logId;
	}
	public void setLogId(String logId){
		this.logId=logId;
	}
	@Size(max=65535,message="{HaLog.logDesc.Size}",groups={ValidGroupSave.class})
	private String logDesc;
	public String getLogDesc(){
		return logDesc;
	}
	public void setLogDesc(String logDesc){
		this.logDesc=logDesc;
	}
	@NotNull(message="{HaLog.machineId.NotNull}",groups={ValidGroupUpdate.class,ValidGroupSave.class})
	@Size(max=32,message="{HaLog.machineId.Size}",groups={ValidGroupSave.class})
	private String machineId;
	public String getMachineId(){
		return machineId;
	}
	public void setMachineId(String machineId){
		this.machineId=machineId;
	}
	@Size(max=255,message="{HaLog.machineNum.Size}",groups={ValidGroupSave.class})
	private String machineNum;
	public String getMachineNum(){
		return machineNum;
	}
	public void setMachineNum(String machineNum){
		this.machineNum=machineNum;
	}
	@Size(max=32,message="{HaLog.customerId.Size}",groups={ValidGroupSave.class})
	private String customerId;
	public String getCustomerId(){
		return customerId;
	}
	public void setCustomerId(String customerId){
		this.customerId=customerId;
	}
	@Size(max=255,message="{HaLog.customerAccount.Size}",groups={ValidGroupSave.class})
	private String customerAccount;
	public String getCustomerAccount(){
		return customerAccount;
	}
	public void setCustomerAccount(String customerAccount){
		this.customerAccount=customerAccount;
	}
	@Size(max=255,message="{HaLog.customerName.Size}",groups={ValidGroupSave.class})
	private String customerName;
	public String getCustomerName(){
		return customerName;
	}
	public void setCustomerName(String customerName){
		this.customerName=customerName;
	}
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	public Date getCreateTime(){
		return createTime;
	}
	public void setCreateTime(Date createTime){
		this.createTime=createTime;
	}
	@Override
	public Serializable getId() {
		return getLogId();
	}
	@Override
	public void setId(Serializable id) {
		setLogId((String)id);
	}
	@Override
	public Object onCycleDetected(Context arg0) {
		HaLog temp=new HaLog();
		temp.setLogId(logId);
		return temp;
	}
	@Override
	public String toString() {
		return "HaLog [logId="+logId+",logDesc="+logDesc+",machineId="+machineId+",machineNum="+machineNum+",customerId="+customerId+",customerAccount="+customerAccount+",customerName="+customerName+",createTime="+createTime+"]";
	}
}